@import 'scss-imports/cssvars';

.card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;

  button {
    height: inherit;
    min-height: var(--mdc-text-button-container-height);
    white-space: normal;
  }
}

:host ::ng-deep {
  mat-list-item .mat-mdc-list-item-unscoped-content {
    gap: 8px;
  }

  .card {
    &.half {
      .product-logo-container,
      .overview {
        display: none;
      }

      .card-action-container {
        padding: 0 0 10px;

        @media (max-width: $breakpoint-xs) {
          padding: 10px 0 0;
        }
      }

      .product-image {
        gap: 0;
        margin-bottom: 10px;
        padding-top: 10px;

        @media (max-width: $breakpoint-xs) {
          margin: 0;
        }
      }

      .product-image img {
        @media (max-width: $breakpoint-xs) {
          width: 120px;
        }
      }

      .product-image-placeholder {
        margin-bottom: 10px;
        min-height: inherit;
      }

      .content-right .header {
        padding-bottom: 6px;
      }

      mat-list-item {
        display: none;

        &:nth-child(1),
        &:nth-child(2),
        &:nth-child(5) {
          display: flex;
        }
      }

      .content-left {
        @media (max-width: $breakpoint-xs) {
          display: none;
        }
      }
    }

    &.full,
    &.half {
      @media (max-width: $breakpoint-xs) {
        .container {
          display: grid;
        }

        .content-left {
          background-color: transparent;
          max-width: 100%;
          order: 2;
        }

        .content-right {
          max-width: 100%;
          order: 1;
        }

        .content-right mat-list mat-list-item:nth-child(3),
        .product-image,
        .product-logo-container {
          display: none;
        }

        .card-action-container {
          padding: 8px 0;
        }
      }
    }
  }
}


.card-content {
  display: flex;
  flex-direction: row;
  height: 100%;
  padding-bottom: 0;
  padding-right: 0;

  .container {
    padding: 0;
  }
}

.header {
  display: flex;
  justify-content: space-between;

  h3 {
    font-size: 24px;

    small {
      align-items: baseline;
      display: inline-flex;
      font-size: 75%;
      font-weight: 600;
      margin-left: 4px;
      opacity: 0.5;
      text-transform: lowercase;
    }
  }
}

.copy-version {
  align-items: center;
  display: flex;
  flex: 1;
  margin-right: -29px;
  min-width: 0;

  .copy-version-text {
    display: inline-flex;
    flex: 1;
    max-width: 78%;
    min-width: 0;

    span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}

.container {
  display: flex;
  flex-grow: 1;
  overflow: hidden;

  &.empty {
    align-items: center;
    background-color: color-mix(in srgb, var(--bg2), transparent 10%);
    flex-direction: column;
    height: 100%;
    left: 0;
    place-content: center center;
    position: absolute;
    text-align: center;
    top: 0;
    width: 100%;
    z-index: 2;

    ix-icon {
      height: 48px;
      width: 48px;
    }

    &.full {
      padding: 0 16px 48px;
    }
  }
}

.product-image {
  margin: 0 20px;
}

.content-left {
  display: flex;
  flex: 1 0 40%;
  flex-direction: column;
  max-width: 40%;
}

.content-right {
  flex: 1 0 60%;
  max-width: 60%;
  padding: 0;

  .header {
    padding: 16px;

    @media (max-width: $breakpoint-xs) {
      padding: 16px 16px 0;
    }
  }
}

.product-logo-container {
  min-height: 87px;
  padding: 16px 32px;
}

.card-action-container {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 16px 16px 32px;
}

.overview {
  padding-left: 16px;
  padding-right: 16px;
}

ix-product-image.passive {
  opacity: 0.5;
}

.image-loader {
  height: 150px;
  margin: auto;
  width: 150px;
}

.inline-loader {
  display: inline-flex;
  flex: 1;
}
